package com.unionfetch.content_home.bean

data class DemoAccountInfo(
    val disable: List<DemoTradeAccount>,
    val enable: List<DemoTradeAccount>
)

data class DemoTradeAccount(
    val account: String,
    val accountName: String,
    val accountType: Int,
    val archived: Int,
    val archivedDate: Any,
    val balance: Double,
    val createDate: String,
    val credit: Any,
    val currency: String,
    val email: Any,
    val enabled: Int,
    val equity: Double,
    val expireDate: Any,
    val expireDays: Int,
    val group: String,
    val headImg: Any,
    val id: Int,
    val investorPassword: Any,
    val leverage: Int,
    val loginState: String,
    val marginLevel: Any,
    val mt4Password: Any,
    val nickname: Any,
    val platform: Int,
    val profit: Any,
    val requestSource: Int,
    val server: Int,
    val serverName: String,
    val tradeState: String,
    val userId: Int
)

fun DemoTradeAccount.change2TradeAccountModel(): TradeAccountModel {
    return TradeAccountModel(
        AccountCategory.DEMO,
        status = TradeAccountStatus.RUNNING,
        tradeNo = this.account,
        balance = this.balance,
        currency = this.currency,
        serverName = this.serverName,
        platform = this.platform,
        leverage = this.leverage,
        accountType = this.accountType,
        assets = this.equity,
        validity = this.expireDays
    )
}